Merge pull request #256 from racktear/master

Switch default ruby to 1.9.1 and run foreman with nohup in huginn_development cookbook

Andrew Cantino 11 years ago
parent
commit
0b287e3149
2 changed files with 19 additions and 2 deletions
  1. 10 0
      deployment/Vagrantfile
  2. 9 2
      deployment/site-cookbooks/huginn_development/recipes/default.rb

+ 10 - 0
deployment/Vagrantfile

@@ -15,6 +15,16 @@ Vagrant.configure("2") do |config|
15 15
     end
16 16
   end
17 17
 
18
+  config.vm.define :prl do |prl|
19
+    prl.vm.box = "parallels/ubuntu-12.04"
20
+
21
+    prl.vm.provision :chef_solo do |chef|
22
+      chef.roles_path = "roles"
23
+      chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
24
+      chef.add_role("huginn_development")
25
+    end
26
+  end
27
+
18 28
   config.vm.define :ec2 do |ec2|
19 29
     ec2.vm.box = "dummy"
20 30
     ec2.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"

+ 9 - 2
deployment/site-cookbooks/huginn_development/recipes/default.rb

@@ -16,12 +16,19 @@ group "huginn" do
16 16
   action :create
17 17
 end
18 18
 
19
-%w("ruby1.9.1" "ruby1.9.1-dev" "libxslt-dev" "libxml2-dev" "curl" "libmysqlclient-dev").each do |pkg|
19
+%w("ruby1.9.1" "ruby1.9.1-dev" "libxslt-dev" "libxml2-dev" "curl" "libmysqlclient-dev" "rubygems").each do |pkg|
20 20
   package pkg do
21 21
     action :install
22 22
   end
23 23
 end
24 24
 
25
+bash "Setting default ruby version to 1.9" do
26
+  code <<-EOH
27
+    update-alternatives --set ruby /usr/bin/ruby1.9.1
28
+    update-alternatives --set gem /usr/bin/gem1.9.1
29
+  EOH
30
+end
31
+
25 32
 git "/home/huginn/huginn" do
26 33
   repository 'git://github.com/cantino/huginn.git'
27 34
   reference 'master'
@@ -59,6 +66,6 @@ bash "huginn has been installed and will start in a minute" do
59 66
   user "huginn"
60 67
   cwd "/home/huginn/huginn"
61 68
   code <<-EOH
62
-    sudo foreman start
69
+    sudo nohup foreman start &
63 70
     EOH
64 71
 end